package com.wangsan.study.security;

/**
 * ResourceAuthItem
 *
 * @author wangsan
 * @date 2016/12/29
 */
public class ResourceAuthItem {
    private String group; // 大分类
    private String name; // 小分类
    private String path; // ant path unqiue
    private String auth; // auth el 暂时只集成AuthenticatedVoter RoleVoter

    public ResourceAuthItem() {
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getAuth() {
        return auth;
    }

    public void setAuth(String auth) {
        this.auth = auth;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ResourceAuthItem authItem = (ResourceAuthItem) o;

        return path.equals(authItem.path);
    }

    @Override
    public int hashCode() {
        return path.hashCode();
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ResourceAuthItem{");
        sb.append("group='").append(group).append('\'');
        sb.append(", name='").append(name).append('\'');
        sb.append(", path='").append(path).append('\'');
        sb.append(", auth='").append(auth).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
